<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class CapchaImage extends MY_Controller
{
    function __construct() {
        parent::__construct();
        $this->load->library('securimage');
    }
    function securimage(){
        $this->securimage->code_length = 4;
        $this->securimage->perturbation = 0.6; // 1.0 = high distortion, higher numbers = more distortion

        $this->securimage->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
        //$img->charset = 'ABCDEFHKLMNPRSTUVWYZabcdefhkmnpstuvwyz234578';
        //$this->securimage->ttf_file = getcwd() . '/ttffonts/AHGBold.ttf';   // single font

        //$img->ttf_font_directory = getcwd() . '/ttffonts';  // random fonts
        //$img->ttf_file = $img->getFontFromDirectory(); // random fonts

        $this->securimage->multi_text_color = array(
        '#6666FF','#660000','#3333CC','#993300','#0060CC',
        '#339900','#6633CC','#330000','#006666','#CC3366',
        );
        $this->securimage->use_multi_text = true;
        $this->securimage->use_transparent_text = true;
        $this->securimage->text_transparency_percentage = 20;
        $this->securimage->num_lines = 3;
        $this->securimage->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
        $this->securimage->image_type = 'png';
        //$this->securimage->background_directory = getcwd() . '/backgrounds';
        $this->securimage->show();
    }
}